<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div></div>
<p></p>
<div id="divA">This is <span>some</span> text!</div>
<script>
    /*
    Node 接口的 textContent 属性表示一个节点及其后代的文本内容。
        语法:
            let text = someNode.textContent;
            someOtherNode.textContent = string;
        返回值:
            一个字符串或 null
        描述:
            textContent 的值取决于具体情况：
    * */

    /*获取元素*/
    const div = document.querySelector("div")
    const box = document.querySelector(".box")
    const p = document.querySelector("p")

    document.getElementById('divA').textContent = 'This text is different!';
    div.textContent="11111"
    p.textContent="222222"
</script>
</body>
</html>